package com.matrix.draft.astigtest.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("")
public class IndexAction {

    @Autowired
    RedisTemplate<Object,Object> redisTemplate;

    @GetMapping("")
    String index(){
        System.err.println("Is null? "+redisTemplate==null);
        System.err.println("Is null2? "+redisTemplate.opsForValue()==null);
        redisTemplate.opsForValue().set("name","Matrix");
        return (String) redisTemplate.opsForValue().get("name");
    }

    @Autowired
    @Qualifier("paintedEggshell")
    String myString;

    @GetMapping("/s")
    String myString(){
        return myString;
    }
}
